package com.entity;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.List;


/**
 * The persistent class for the CLUETYPE database table.
 * 
 */
@Entity
@NamedQuery(name="Cluetype.findAll", query="SELECT c FROM Cluetype c")
public class Cluetype implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="CLUETYPE_CTYPENO_GENERATOR", sequenceName="SEQ",initialValue=1,allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CLUETYPE_CTYPENO_GENERATOR")
	private long ctypeno;

	private String cluename;

	//bi-directional many-to-one association to Saleclue
	@OneToMany(mappedBy="cluetype")
	@JSONField(serialize=false)
	private List<Saleclue> saleclues;

	public Cluetype() {
	}

	public long getCtypeno() {
		return this.ctypeno;
	}

	public void setCtypeno(long ctypeno) {
		this.ctypeno = ctypeno;
	}

	public String getCluename() {
		return this.cluename;
	}

	public void setCluename(String cluename) {
		this.cluename = cluename;
	}

	public List<Saleclue> getSaleclues() {
		return this.saleclues;
	}

	public void setSaleclues(List<Saleclue> saleclues) {
		this.saleclues = saleclues;
	}

	public Saleclue addSaleclue(Saleclue saleclue) {
		getSaleclues().add(saleclue);
		saleclue.setCluetype(this);

		return saleclue;
	}

	public Saleclue removeSaleclue(Saleclue saleclue) {
		getSaleclues().remove(saleclue);
		saleclue.setCluetype(null);

		return saleclue;
	}

}